﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Drawing;

namespace Net4.Common.Entities
{
    public class ImageInfo : Attachment
    {
        #region Properties

        private int _Width;

        public int Width
        {
            get { return _Width; }
            set { _Width = value; }
        }

        private int _Height;

        public int Height
        {
            get { return _Height; }
            set { _Height = value; }
        }

        public string Snapshot
        {
            get
            {
                return AttachmentManager.Instance.GetRelativeStorageLocation(SNAPSHOTSTRING + _FileName);
            }
        }

        public static readonly string SNAPSHOTSTRING = "snapshot_";

        #endregion

        public ImageInfo(string filename, int parentId)
            : base(filename, parentId)
        {
            Image image = Image.FromFile(AttachmentManager.Instance.GetPhysicalStorageLocation(filename));
            _Width = image.Width;
            _Height = image.Height;
        }

        public ImageInfo()
        { 
            
        }
    }
}
